package businesslogic.score;

import java.rmi.RemoteException;
import java.util.ArrayList;

import javax.swing.table.DefaultTableModel;

import dataService.scoreDataService.ScoreDataService;

import po.coursepo.CourseID;
import po.scorepo.Score;
import po.userpo.StuID;
import useDatabase.java.getTable;
import useDatabaseService.GetTableImpli;
import vo.Limitation;
import vo.scorevo.ShowScoreVO;
import Enum.Factor;
import Enum.Faculty;
import businesslogicservice.scoreblservide.ShowScoreBLService;

public class ShowScore implements ShowScoreBLService{
	String courseId;
	public ArrayList<Score> showScore(ShowScoreVO showScoreVO)  throws RemoteException{
		String condition;
		String type;
		String id;
		type = showScoreVO.getType();
		id = showScoreVO.getID();
		Factor factor;
		if(type.equals("courseName")){
			factor = Factor.CourseName;
		}else if(type.equals("stuId")){
			factor = Factor.StudentID;
		}else{
			return null;
		}
		Limitation limitation = new Limitation(factor, id);
		ArrayList<Limitation> limitations = new ArrayList<Limitation>();
		limitations.add(limitation);
		ScoreDataService scoreDataSerivce = new ScoreDataService();
		ArrayList<Score> scoreList = new ArrayList<Score>();
		scoreList = scoreDataSerivce.get(limitations);
		return scoreList;
	}
	
	public String getCourseId(){
		return courseId;
	}

}
